Field of the Invention
The present invention relates to code generation and, more specifically, to generating optimized code.
Background Information
Engineers, scientists and other users often work with computer-based, high-level development tools or environments to perform algorithm development, data visualization, simulation, and model design, among other tasks. Exemplary high-level development tools include the MATLAB® and Simulink® technical computing environments from The MathWorks, Inc. of Natick, Mass. With the Simulink® technical computing environment, a user creates an executable graphical model by selecting blocks from a library browser, placing them onto a canvas, for example in a graphical editor, and connecting them with lines that establish mathematical relationships and/or signals between the blocks. The Stateflow® modeling environment is an extension to the Simulink® technical computing environment that allows a user to specify state machines and flow charts. A Stateflow chart may be created by selecting states, junctions, and functions from a graphical palette, and entering them into a drawing window. The user can then create transitions by connecting states and junctions together.
Other add-on products or tools exist for generating code from Simulink models, MATLAB files and/or functions, often referred to as M-files and/or M-functions, and/or Stateflow charts. Specifically, a Simulink Hardware Description Language (HDL) Coder™ add-on product, also available from The MathWorks, Inc., generates HDL code based on Simulink models or Stateflow charts. The generated HDL code can be exported to synthesis and layout tools for hardware realization onto target hardware, such as Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Complex Programmable Logic Devices (CPLDs), etc. With the release of the Simulink HDL Coder add-on product, the Simulink technical computing environment can now be used for electronic design automation, and other design and exploration functions.